#include"processbar.h"

double bandwidth=1024*1024*1.0;


void download(double fsize,callback_t cb)
{
  double current=0.0;
  
  printf("下载开始\n");
  while(current<=fsize)
  {
    cb(fsize,current);
    usleep(100000);
    current+=bandwidth;
  }
 printf("\n");

  printf("下载完成\n");

}

int main(){
  //ForTest();
  
  //procbar();
  
  download(10.0*1024*1024,procbar);
  download(50.0*1024*1024,procbar);
  download(25.0*1024*1024,procbar);
  download(100.0*1024*1024,procbar);
  return 0;
}
